package ru.spbau.database.group3.parser.test;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * User: stas
 * Date: 1/29/13
 * Time: 9:10 PM

 */
public final class RequestExamples {

    public static final String[] cols = {"age", "name", "city"};

    public static final String[] types = {"INT", "DOUBLE", "VARCHAR(64)"};
    public static final String[] orders = {"DESC", "ASC", "ASC"};

    public static final String[] values = {"23", "John", "NYC"};
//    public static final String[] values2 = {"53", "Mike"};

    public static final String SELECT1 = "SELECT age, name, city FROM table_number3 WHERE age <= 1";
    public static final String ANSWER1 = "SelectInstruction{tablename='table_number3'," +
            " constraint=RecordConstraint{colName='age ', value=' 1', cOp=ConditionOperator{representation='<='}}, colNames=[age, name, city]}";

    public static final String SELECT2 = "SELECT * FROM table";
    public static final String ANSWER2 = "SelectInstruction{tablename='table', " +
            "constraint=RecordConstraint{colName='', value='', cOp=ConditionOperator{representation=''}}, colNames=[*]}";

    public static final String SELECT3 = "SELECT salary, age table";

    public static final String CREATETABLE1 = "CREATE TABLE Bullshit(age INT,  name VARCHAR(23), salary DOUBLE)";
    public static final String INS1 = "INSERT INTO Bullshit(age, name, salary) VALUES (32, \"D1ck Roman\", 32462.423)";

    public static final String ANSWER3 = "CreateTableInstruction{" +
            "tablename='" + "table" + '\'' +
            ", types=" + Arrays.asList(types) +
            ", names=" + Arrays.asList(cols) +
            '}';

    public static final String CREATETABLE2 = "CREATE TABLE fasgh(hgs, fsf INT)";




    public static final String CREATEINDEX1 = "CREATE INDEX indexname ON table(age DESC, name , city ASC) USING HASH";
    public static final String ANSWER4 = "CreateIndexInstruction{" +
            "indexname='" + "indexname" + '\'' +
            ", tablename='" + "table" + '\'' +
            ", cols=" + Arrays.asList(cols) +
            ", orders=" + Arrays.asList(orders) +
            ", type='" + "HASH" + '\'' +
            '}';

    public static final String CREATEINDEX2 = "CREATE INDEX afafafaf(col1 DESC, col2 DESC) USING BTREE";

    public static final String INSERT1 = "INSERT INTO table(age, name, city) VALUES (23, John, NYC)";
    public static final String ANSWER5 = "InsertInstruction{" +
            "tablename='" + "table" + '\'' +
            ", colNames=" + Arrays.asList(cols) +
            ", values=" + Arrays.asList(values) +
            '}';

    public static final String INSERT2 = "INSERT INTO table(age, city) VALUES (23, John, NYC)";

    public static final String UPDATETABLE1 = "UPDATE TABLE table SET age=53, name = Mike WHERE city =SPB";
    public static final String ANSWER6 = "UpdateTableInstruction{tablename='table', cols=[age, name], vals=[53, Mike]," +
            " constraint='RecordConstraint{colName='city ', value='SPB', cOp=ConditionOperator{representation='='}}'}";

    public static final String UPDATETABLE2 = "UPDATE TABLE table(age=53, name = Mike) WHERE city =SPB";

    public static final String DELETE1 = "DELETE FROM table WHERE name = Bob";
    public static final String ANSWER7 = "DeleteInstruction{tablename='table'," +
            " constraint='RecordConstraint{colName='name ', value=' Bob', cOp=ConditionOperator{representation='='}}'}";

    public static final String DELETE2 = "DELETE FROM table WHERE  = Bod";

}
